package com.qf.service.impl;

import com.qf.dao.LbPicDao;
import com.qf.pojo.LbPic;
import com.qf.service.LbPicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class LbPicServiceImpl implements LbPicService {
    @Autowired(required = false)
    LbPicDao lbPicDao;
    @Override
    public List<LbPic> findAll() {
        return lbPicDao.findAll();
    }

    @Override
    public List<LbPic> findByStatu() {
        return lbPicDao.findByStatu();
    }

    @Override
    public int addAndUpdate(LbPic lbPic) {
        if(lbPic.getLid()!=null){
            return lbPicDao.add(lbPic);
        }
        return lbPicDao.update(lbPic);
    }

    @Override
    public int delete(Integer id) {
        return lbPicDao.delete(id);
    }
}
